package cn.cc.common.elasticsearch.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

/**
 * @program: smail-mi-cloud
 * @description:es配置
 * @author: Mr.WuChao
 * @create: 2021-07-20 11:14
 **/
@Configuration
public class EsConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient() throws IOException {
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("192.168.114.100", 9200, "http")));
        return client;
    }
}
